Skip to content

Conversation

@jiexi
Copy link
Contributor

@jiexi jiexi commented Nov 21, 2025

Explanation

The solana connect package will require the MultichainApiClient provider to be available before the SDK is connected to the wallet in order to announce itself via a wallet standard event. This is mainly problematic in the case of the MWP flow in which a connection cannot be automatically established without user input. Additionally, the MWP Transport cannot be used as-is with the MultichainApiClient despite having similar interfaces because the deeplinking/qr code logic lives in a different layer (MultichainSDK). This implies that all requests must flow through MultichainSDK in order to correctly trigger any MWP related flows.

This PR achieves that by introducing a new MultichainApiClientWrapperTransport which is meant slowly as a wrapper around the MultichainSDK that can be used to instantiate and expose MultichainApiClient without the dapp having to establish a connection first. The MultichainApiClientWrapperTransport remaps requests to their corresponding methods on the MultichainSDK or respond with mock empty/error responses where appropriate.

MultichainApiClientWrapperTransport is not meant to be used with anything other than the MultichainApiClient

This can be tested by accessing window.mmsdk.provider

NOTE: wallet_invokeMethod is broken currently.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@jiexi jiexi requested a review from a team as a code owner November 21, 2025 00:25
@jiexi jiexi changed the title jl/expose multichain api client with mwp transport before connect WIP: Use provider transport when SDK session hasn't been instantiated yet Nov 21, 2025
@jiexi jiexi changed the title WIP: Use provider transport when SDK session hasn't been instantiated yet WIP: Expose MultichainApiClient provider with a transport adapter without needing to connect first Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants